<!DOCTYPE html>
<html>
<head>
	<title><?php echo CHtml::encode($this->pageTitle) . ' | '.Yii::app()->name; ?></title>
	<meta name="description" content="" />
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
	<!--[if lt IE 9]>
	<script src="./js/libs/html5shiv.min.js"></script>
	<script src="./js/libs/modernizr.custom.js"></script>
	<![endif]-->
	
	<!--[if !IE]><!--><script>  
	if (window.navigator.msPointerEnabled) {
		document.documentElement.className+='ie_10_11';
	}
	</script><!--<![endif]-->
	
	<link href="<?php echo $this->getBaseUrl(); ?>/css/style.css" rel="stylesheet" />
	<!--[if lte IE 9]>
	<link href="<?php echo $this->getBaseUrl(); ?>/css/ie.css" rel="stylesheet" />
	<![endif]-->
</head>
<body>
<?php
    $selected_region_name = (0 < Yii::app()->session['region_id']) ? GxHtml::encode($this->getRegionAttr(Yii::app()->session['region_id'], 'name')) : Yii::t('app', 'Все регионы');
    $selected_city_name = (0 < Yii::app()->session['city_id']) ? GxHtml::encode($this->getCityAttr(Yii::app()->session['city_id'], 'name')) : Yii::t('app', 'Все города');
?>

<section class="container">
	<!-- HEADER -->
	<header>
		<section class="outer_1">
			<div class="inner">
				<div class="group_1">
					<div class="user_menu">
						<a href="#"><span>Вход</span></a>
					</div>
					<ol class="region">
						<li><a href="#" class="region-modal" data-target="#regions-modal"><?php echo $selected_region_name;?></a></li>
						<li class="active"><a href="#"><?php echo $selected_city_name ?></a></li>
					</ol>
				</div>
				<div class="group_2 counters">
					<?php echo Yii::t('app', 'Предприятий: ');?> <b>100500</b>
					<?php echo Yii::t('app', 'Просмотров за месяц: ');?> <b>238840</b>
				</div>
			</div>
		</section>
		
		<section class="outer_2">
			<div class="inner">
				<div class="group_1">
					<a href="/" class="logo"><img src="<?php echo $this->getBaseUrl(); ?>/img/logos/header.png" alt="Твой Город" />КАТАЛОГ ПРЕДПРИЯТИЙ</a>
				</div>
				<div class="group_2">
					<div class="width_outer">
						<form method="post" action="<?php echo Yii::app()->createUrl('search/index');?>">
							<input type="text" class="textfield" name="sq" value="<?php echo isset($_REQUEST['sq']) ? GxHtml::encode($_REQUEST['sq']) : '';?>" placeholder="<?php echo Yii::t('app', 'Поиск');?>" />
							<input type="submit" value="&nbsp;" class="submit" />
						</form>
						<div class="add_firm">
              <?php 
                $buttonLink = Yii::app()->createUrl( Yii::app()->user->isGuest ? '/user/registration' : '/user/myfirms');
                $buttonTxt = Yii::t('app', Yii::app()->user->isGuest ? 'Новая фирма' : 'Мои фирмы');
              ?>
              <a href="<?php echo $buttonLink;?>"><span><?php echo $buttonTxt;?></span></a>
            </div>
					</div>
				</div>
				<nav class="group_3">
					<ul class="menu">
						<li class="products">
							<a href="<?php echo Yii::app()->createUrl('/rubrics', array('st_id' => 0)); ?>"><span><?php echo Controller::getServiceType(0);?></span></a>
							<div class="hover_category_top">
							</div>
							<div class="hover_category">
								<div class="container_menu_category">
                  <?php foreach(Yii::app()->basestatic->rubrics(0) as $rubric):?>
                    <div class="group_menu_category">
                      <a class="name_group_menu_category" href="<?php echo Yii::app()->createUrl('/rubrics/single', array('st_id' => 0, 'rid' => $rubric['id'])); ?>">
                        <?php echo GxHtml::encode($rubric['name']);?>
                      </a>
                      <?php if (0 < count($rubric['categories'])):?>
                          <ul class="subgroup_menu_category">
                            <?php foreach($rubric['categories'] as $category):?>
                                <li class="item_menu_category">
                                  <!-- for tag a active link!!!     class="active_menu_category_item" -->
                                  <a  href="<?php echo Yii::app()->createUrl('/category', array('st_id' => 0,'rid'=>$rubric['id'], 'cid'=>$category['id']/*, 'slug'=> $rubric->slug*/));?>">
                                    <?php echo GxHtml::encode($category['name']); ?>
                                  </a>
                                </li>
                            <?php endforeach;?>
                          </ul>
                      <?php endif;?>
                    </div>
                  <?php endforeach;?>                
								</div>
							</div>
						</li>
						<li class="services">
							<a href="<?php echo Yii::app()->createUrl('/rubrics', array('st_id' => 1)); ?>"><span><?php echo Controller::getServiceType(1);?></span></a>
							<div class="hover_category_top">
							</div>
							<div class="hover_category">
								<div class="container_menu_category">
                  <?php foreach(Yii::app()->basestatic->rubrics(1) as $rubric):?>
                    <div class="group_menu_category">
                      <a class="name_group_menu_category" href="<?php echo Yii::app()->createUrl('/rubrics/single', array('st_id' => 1, 'rid' => $rubric['id'])); ?>">
                        <?php echo GxHtml::encode($rubric['name']);?>
                      </a>
                      <?php if (0 < count($rubric['categories'])):?>
                          <ul class="subgroup_menu_category">
                              <?php foreach($rubric['categories'] as $category):?>
                                  <li class="item_menu_category">
                                    <!-- for tag a active link!!!     class="active_menu_category_item" -->
                                    <a  href="<?php echo Yii::app()->createUrl('/category', array('st_id' => 1,'rid'=>$rubric['id'], 'cid'=>$category['id']/*, 'slug'=> $rubric->slug*/));?>">
                                      <?php echo GxHtml::encode($category['name']); ?>
                                    </a>
                                  </li>
                              <?php endforeach;?>
                          </ul>
                      <?php endif;?>
                    </div>
                  <?php endforeach;?>                
								</div>
							</div>              
						</li>
					</ul>
				</nav>
			</div>
		</section>
	</header>
	
	<section class="outer">
    <div class="mp_main_container">
      <?php if(isset($this->breadcrumbs)):?>
        <?php $this->widget('zii.widgets.CBreadcrumbs', array('links'=>$this->breadcrumbs,)); ?>
      <?php endif?>	
      <?php echo $content; ?>    
    
    
    <!--
          <h2 class="mp_name_menu_category">Недавно добавленные фирмы</h2>
          <div class="mp_grid">
            <div class="mp_firm_item">
              <div class="mp_conteiner">
                <div class="mp_logoConteiner">
                  <a class="mp_logofirm"></a>
                </div>						
                <div class="mp_name">
                    <a>1 Markanent- gfgfuj jhgjh hgkhf hgkg hghkhj hkgfgjhk hgkjf</a>
                </div>
              
              </div>
              <div class="rubriki">
                <nav class="mp_rubriki">
                  <ul>
                    <li><a href="#">Service</a></li>
                    <li><a href="#">Driver</a></li>
                    <li><a href="#">MarketShtorm</a></li>
                    <li><a href="#">Systdfgdg  dg</a></li>
                    <li><a href="#">System book</a></li>
                    <li><a href="#">System sexuality</a></li>
                  </ul>
                </nav>
              </div>
            </div>
          </div>				
          
          <div class="mp_grid">
          <div class="mp_firm_item">
            <div class="mp_conteiner">
              <div class="mp_logoConteiner">
                <a class="mp_logofirm"></a>
              </div>						
              <div class="mp_name">
                  <a>2 Markanent- gfgfuj jhgjh hgkhf hgkg hghkhj hkgfgjhk hgkjf gfjjf  fgj jf   fjtgjfjhfj  fjhjhfj fyhjhjhfj  ykfiku</a>
              </div>
            
            </div>
            <div class="rubriki">
              <nav class="mp_rubriki">
                <ul>
                  <li><a href="#">Service</a></li>
                  <li><a href="#">Driver</a></li>
                  <li><a href="#">MarketShtorm</a></li>
                  <li><a href="#">Systdfgdg  dg</a></li>
                  <li><a href="#">System book</a></li>
                  <li><a href="#">System sexuality</a></li>
                </ul>
              </nav>
            </div>
          </div>
          </div>
          <div class="mp_grid">
          <div class="mp_firm_item">
            <div class="mp_conteiner">
              <div class="mp_logoConteiner">
                <a class="mp_logofirm"></a>
              </div>						
              <div class="mp_name">
                  <a>3 Markanent- gfgfuj jhgjh hgkhf hgkg hghkhj hkgfgjhk hgkjf gfjjf  fgj jf   fjtgjfjhfj  fjhjhfj fyhjhjhfj  ykfiku</a>
              </div>
            
            </div>
            <div class="rubriki">
              <nav class="mp_rubriki">
                <ul>
                  <li><a href="#">Service</a></li>
                  <li><a href="#">Driver</a></li>
                  <li><a href="#">MarketShtorm</a></li>
                  <li><a href="#">Systdfgdg  dg</a></li>
                  <li><a href="#">System book</a></li>
                  <li><a href="#">System sexuality</a></li>
                </ul>
              </nav>
            </div>
          </div>
          </div>
          <div class="mp_grid">
          <div class="mp_firm_item">
            <div class="mp_conteiner">
              <div class="mp_logoConteiner">
                <a class="mp_logofirm"></a>
              </div>						
              <div class="mp_name">
                  <a>4 Markanent- gfgfuj jhgjh hgkhf hgkg hghkhj hkgfgjhk hgkjf gfjjf  fgj jf   fjtgjfjhfj  fjhjhfj fyhjhjhfj  ykfiku</a>
              </div>
            
            </div>
            <div class="rubriki">
              <nav class="mp_rubriki">
                <ul>
                  <li><a href="#">Service</a></li>
                  <li><a href="#">Driver</a></li>
                  <li><a href="#">MarketShtorm</a></li>
                  <li><a href="#">Systdfgdg  dg</a></li>
                  <li><a href="#">System book</a></li>
                  <li><a href="#">System sexuality</a></li>
                </ul>
              </nav>
            </div>
          </div>
          </div>
          <div class="mp_grid">
          <div class="mp_firm_item">
            <div class="mp_conteiner">
              <div class="mp_logoConteiner">
                <a class="mp_logofirm"></a>
              </div>						
              <div class="mp_name">
                  <a>5 Markanent- gfgfuj jhgjh hgkhf hgkg hghkhj hkgfgjhk hgkjf gfjjf  fgj jf   fjtgjfjhfj  fjhjhfj fyhjhjhfj  ykfiku</a>
              </div>
            
            </div>
            <div class="rubriki">
              <nav class="mp_rubriki">
                <ul>
                  <li><a href="#">Service</a></li>
                  <li><a href="#">Driver</a></li>
                  <li><a href="#">MarketShtorm</a></li>
                  <li><a href="#">Systdfgdg  dg</a></li>
                  <li><a href="#">System book</a></li>
                  <li><a href="#">System sexuality</a></li>
                </ul>
              </nav>
            </div>
          </div>
          </div>
          <div class="mp_grid">
          <div class="mp_firm_item">
            <div class="mp_conteiner">
              <div class="mp_logoConteiner">
                <a class="mp_logofirm"></a>
              </div>						
              <div class="mp_name">
                  <a>6 Markanent- gfgfuj jhgjh hgkhf hgkg hghkhj hkgfgjhk hgkjf gfjjf  fgj jf   fjtgjfjhfj  fjhjhfj fyhjhjhfj  ykfiku</a>
              </div>
            
            </div>
            <div class="rubriki">
              <nav class="mp_rubriki">
                <ul>
                  <li><a href="#">Service</a></li>
                  <li><a href="#">Driver</a></li>
                  <li><a href="#">MarketShtorm</a></li>
                  <li><a href="#">Systdfgdg  dg</a></li>
                  <li><a href="#">System book</a></li>
                  <li><a href="#">System sexuality</a></li>
                </ul>
              </nav>
            </div>
          </div>
          </div>
          -->
    </div>
	</section>
	
	<div class="city"></div>
</section>

<!-- FOOTER -->
<footer>
	<div class="inner">
		<div class="logo"><a href="./"><img src="./img/logos/footer.png" alt="Твой Город" /></a></div>
		<div class="copyright">&copy; <?php echo date('Y');?> <?php echo Yii::t('app', 'Все права защищены.');?></div>
		<nav class="menu">
			<ul>
				<li><a href="<?php echo Yii::app()->createUrl('/pages/about'); ?>"><?php echo Yii::t('app', 'О нас');?></a></li>
				<li><a href="<?php echo Yii::app()->createUrl('/pages/contact'); ?>"><?php echo Yii::t('app', 'Контакты');?></a></li>
				<li><a href="<?php echo Yii::app()->createUrl('/pages/privacy'); ?>"><?php echo Yii::t('app', 'Правила пользования');?></a></li>
			</ul>
		</nav>
	</div>
</footer>
<!-- Modal -->
<div id="regions-modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="regionsLabel" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h3 id="regionsLabel">
			<span data-href="/regions/select">1111</span>
		</h3>
	</div>
	<div class="modal-body">
		<div class="row-fluid">
			<div class="region_cols span4" id="regions_col_0"></div>
			<div class="region_cols span4" id="regions_col_1"></div>
			<div class="region_cols span4" id="regions_col_2"></div>
		</div>
	</div>
	<!--
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
		<button class="btn btn-primary">Save changes</button>
	</div>
	-->
</div>
<!-- END FOOTER -->
<script type="text/javascript">
  var regions = <?php echo json_encode($this->regionsData()); ?>;
  var regions_url = "<?php echo Yii::app()->createUrl('regions/index'); ?>";
  var json_regions_url = "<?php echo Yii::app()->createUrl('regions/regions'); ?>";
  var json_cities_url = "<?php echo Yii::app()->createUrl('regions/cities'); ?>";
  var flag_show_RegionsPopup = <?php echo ($this->flag_showRegionsPopup) ? 'true' : 'false'; ?>;
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="<?php echo $this->getBaseUrl(); ?>/js/libs/jquery-1.11.0.min.js"><\/script>');</script>
<script src="<?php echo $this->getBaseUrl(); ?>/js/libs/jquery.imagesloaded.min.js"></script>
<script src="<?php echo $this->getBaseUrl(); ?>/js/libs/retina-1.1.0.min.js"></script>
<script src="<?php echo $this->getBaseUrl(); ?>/js/libs/jquery.leanModal.js"></script>

<script src="<?php echo $this->getBaseUrl(); ?>/js/base.js"></script>
</body>
</html>